package com.loan.exeception;

/**
 * @author zhangchong
 * 自定义异常类
 */
public class AppException extends RuntimeException{

    private int code ;
    private String msg ;


    public AppException(AppExceptionCodeMsg appExceptionCodeMsg){
        this.code = appExceptionCodeMsg.getCode();
        this.msg = appExceptionCodeMsg.getMsg();
    }
    public AppException(int code,String msg){
        this.code = code;
        this.msg = msg;

    }
    public AppException(String msg){
        this.msg = msg;
        this.code=500;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
